<%@ Page Language="C#"  MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
<%@ MasterType VirtualPath="~/Master.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:LoginView ID="LoginView1" runat="server">

        <LoggedInTemplate>
            <p class="errorMessage">You can not login twice</p>
        </LoggedInTemplate>

        <AnonymousTemplate>

            <h1>Login here</h1>

            <p>Please enter the following information:</p>

            <asp:Login ID="Login1" runat="server" PasswordRecoveryText ="Forgot your password?" DestinationPageUrl="Control/Questionnaires.aspx" VisibleWhenLoggedIn="False" FailureText="The username and password combination you entered is invalid">

                <LayoutTemplate>

                    <div class="formInputTitle"><asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label></div>
                    <asp:TextBox ID="UserName" runat="server" CssClass="formInput" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="Please enter your username" ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator>
                    
                    <br /><br />
                    
                    <div class="formInputTitle"><asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></div>
                    <asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="formInput" onfocus="this.className='formInputOver';" onblur="this.className='formInput';"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Please enter your password" ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator>

                    <p><asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time" CssClass="checkBox" /></p>

                    <p class="errorMessage"><asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></p>

                    <p><asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Sign in" ValidationGroup="ctl00$Login1" /></p>

                    <p><asp:HyperLink ID="PasswordRecoveryLink" runat="server">Forgot your password?</asp:HyperLink></p>
                
                </LayoutTemplate>

            </asp:Login>

            <h2>Don't forget to logout if you're accessing this site from a public computer</h2>

        </AnonymousTemplate>
        
    </asp:LoginView>
 
</asp:Content>